import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Manage from '../views/Manage.vue'
//使用路由
Vue.use(VueRouter)
//配置路由
const routes = [
  {
    path: '/home',
    name: 'home',
    component: Home
  },
  {
    path: '/manage',
    name: 'manage',
    component: Manage
  }
]
//创建路由实例
const router = new VueRouter({
  linkActiveClass: 'active',  //路由匹配样式
  routes
})

router.beforeEach((to, from, next) => {
  next()
})

//导出
export default router
